"use strict";

const Mock = require("mockjs");
module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
     */
    const data = Mock.mock({
      "rows|100": [
        {
          username: "@cname",
          password: "@id",
          avatar: "@url",
          email: "@email",
          "articles|1-100": 50,
          "favs|1-100": 50,
          "is_vip|0-1": 0,
          "status|0-1": 0,
        },
      ],
    });
    return queryInterface.bulkInsert("users", data.rows, {});
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete("users", null, {});
  },
};
